<!DOCTYPE html>
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="dist/code-lighter.css">
		<script type="text/javascript" src="dist/code-lighter.js"></script>
		<script type="text/javascript">

			window.onload = function () {
				//comment
				var code = lighter.code({target: document.getElementById('htmlarea'), language:'html', style: 'light'});
				var code2 = lighter.code({target: document.getElementById('javascriptarea'), language:'javascript', style: 'light'});
				var code3 = lighter.code({target: document.getElementById('cssarea'), language:'css', style: 'light'});
				code.on();
				code2.on();
				code3.on();

				var on = true;
				lighter.addEventHandler(document.getElementById('toggle'), 'click', function(){
					if (on) {
						on = false;
						code.off();
						code2.off();
						code3.off();
					}else{
						on = true;
						code.on();
						code2.on();
						code3.on();
					}

				});
			}
		</script>
	</head>
	<body>
<pre><div id="cssarea">#hi, tagname{
		background: #eee;
		margin: 1px 2px 0 4px;
		font-family: "microsoft Yahei", Sans;
		background-image: url("./logo.gif");
		-webkit-box-shadow: 5px 5px 15px #fff;
		transform: rotate(3deg);
}</div></pre>
<pre><div id="htmlarea">&lt;span&nbsp;class='welcome'&gt;hi&lt;/span&gt;
	&lt;!--&nbsp;ok&nbsp;--&gt;
	&lt;script&nbsp;type='text/javascript'&gt;&lt;/script&gt;
	&lt;!-- half comment</div></pre>

		<pre><div id="javascriptarea" codelighter="javascript">//comment
function helloworld() {

	var x = 1.5 + 6;
	if (x > 5) {
		alert("x:" + x);
	}

	windows.onload = function(){
		document.write('yes');
		document.write("n\"o");
	}
	
	var str = "fs\
		fds\
	";

	var k256 = [1, 2, 3, 4];

	for (var i = 0; i < 10; i++) {
		console.log(i);
	}

	(function(){
		console.log('hello world');
		/*
		* this is block comment
		*
		* a new line
		*/
	}());

	alert("he\"llo");
}
</div></pre>

	<button id="toggle">Toggle Highlight</button>
	</body>
</html>